package com.systemdevelopment.mainproject.View.demo;

import com.systemdevelopment.mainproject.Model.Book;

import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.HashSet;

public class tableViewController {
        public static Class type;
        public static HashMap<String,Method>getters;
        public static HashMap<String,Method>setters;
        public static Field[] fields;
        public static Method[] methods;
        public static void initBean(Class t)
        {
            type=t;
            fields=type.getFields();
            methods=type.getMethods();
            getters=new HashMap<>();
            setters=new HashMap<>();
            for (Method m:methods) {
                if(m.getName().matches("get.*"))
                {
                    getters.put(m.getName().replaceFirst("get",""),m);
                }
                else if(m.getName().matches("set.*"))
                {
                    setters.put(m.getName().replaceFirst("set",""),m);
                }
            }

        }


    public static void main(String[] args) {
        System.out.println(getters);
    }
}
